//
//  CemeraTableViewCell.m
//  A段项目
//
//  Created by 官琛 on 15-6-19.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "CemeraTableViewCell.h"

@implementation CemeraTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        if (WIDTH == 320 && HEIGHT == 568) {
            [self creatTable5];
        }
        if (WIDTH == 414 && HEIGHT == 736) {
            [self creatTable6];
        }
        if (WIDTH == 375 && HEIGHT == 667){
            [self creatTable6];
        }

    }
    
    return self;
}

-(void)creatTable5
{
    
    self.mainLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, WIDTH, 30)];
    self.mainLabel.backgroundColor = [UIColor colorWithRed:87 / 255.0 green:196/ 255.0 blue:211/ 255.0 alpha:0.5];
    self.mainLabel.textColor = [UIColor colorWithRed:236/255.0 green:236/255.0 blue:236/255.0 alpha:1];
    self.mainLabel.layer.shadowOffset = CGSizeMake(0, 3);
    self.mainLabel.layer.shadowRadius = 10.0;
    self.mainLabel.layer.shadowOpacity = 0.5;
    self.mainLabel.layer.shadowColor = [UIColor blackColor].CGColor;
//    self.mainLabel.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.mainLabel];
    self.mainLabel.font = [UIFont boldSystemFontOfSize:18];
    
    [_mainLabel autorelease];
    
    self.subLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, self.mainLabel.frame.origin.y+30, 300, 80)];
    self.subLabel.numberOfLines = 0;
    self.subLabel.font = [UIFont systemFontOfSize:16];
//    self.subLabel.backgroundColor = [UIColor redColor];
    self.subLabel.textColor = [UIColor lightGrayColor];
    [self.contentView addSubview:self.subLabel];
    [_subLabel autorelease];
    
}


-(void)creatTable6
{
    
    self.mainLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, WIDTH, 30)];
    self.mainLabel.backgroundColor = [UIColor colorWithRed:87 / 255.0 green:196/ 255.0 blue:211/ 255.0 alpha:0.5];
    self.mainLabel.textColor = [UIColor colorWithRed:236/255.0 green:236/255.0 blue:236/255.0 alpha:1];
    self.mainLabel.layer.shadowOffset = CGSizeMake(0, 3);
    self.mainLabel.layer.shadowRadius = 10.0;
    self.mainLabel.layer.shadowOpacity = 0.5;
    self.mainLabel.layer.shadowColor = [UIColor blackColor].CGColor;
    
    [self.contentView addSubview:self.mainLabel];
     self.mainLabel.font = [UIFont boldSystemFontOfSize:18];

    [_mainLabel autorelease];
    
    self.subLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, self.mainLabel.frame.origin.y+30, 350, 70)];
    self.subLabel.numberOfLines = 0;
   self.subLabel.font = [UIFont systemFontOfSize:16];
    //self.subLabel.backgroundColor = [UIColor blackColor];
    self.subLabel.textColor = [UIColor lightGrayColor];
    [self.contentView addSubview:self.subLabel];
    [_subLabel autorelease];

}


-(void)setCemera:(Cemera *)cemera
{
    if (_cemera != cemera) {
        [_cemera release];
        _cemera = [cemera retain];
    }
    
    NSString *set = cemera.topListNameCn;
    
    self.mainLabel.text = [NSString stringWithFormat:@"   %@",set];
    self.subLabel.text = cemera.sub;
   
}

















- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
